<admintpl file="header" />
<style type="text/css">
.pic-list li {
	margin-bottom: 5px;
}
</style>
<script type="text/html" id="photos-item-wrapper">
	<li id="savedimage{id}">
		<input id="photo-{id}" type="hidden" name="photos_url[]" value="{filepath}">
		<input id="photo-{id}-name" type="text" name="photos_alt[]" value="{name}" style="width: 160px;" title="图片名称">
		<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;" onclick="parent.image_preview_dialog(this.src);">
		<a href="javascript:upload_one_image('图片上传','#photo-{id}');">替换</a>
		<a href="javascript:$('#savedimage{id}').remove();">移除</a>
	</li>
</script>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
	        <li class="active"><a href="#A" data-toggle="tab">{:L('GENERAL_SETTING')}</a></li>
	    </ul>
		<form class="form-horizontal js-ajax-form" action="{:U('AdminCategory/add_post')}" method="post">
			<div class="tabbable">
		        <div class="tab-content">
		          <div class="tab-pane active" id="A">
						<fieldset>
							<!--<div class="control-group">-->
								<!--<label class="control-label">{:L('PARENT')}</label>-->
								<!--<div class="controls">-->
									<!--<select name="parent">-->
										<!--<option value="0">{:L('ROOT')}</option>-->
										<!--{$terms_tree}-->
									<!--</select>-->
								<!--</div>-->
							<!--</div>-->
							<div class="control-group">
								<label class="control-label">{:L('CATEGORY_TYPE')}</label>
								<div class="controls">
									<select name="taxonomy">
										<foreach name="taxonomys" item="vo">
											<option value="{$key}">{$vo}</option>
										</foreach>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('NAME')}</label>
								<div class="controls">
									<input type="text" name="name" value=""><span class="form-required">*</span>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('CATEGORY_DESCRIPTION')}</label>
								<div class="controls">
									<textarea name="description" rows="5" cols="57"></textarea>
								</div>
							</div>
							<div class="control-group istop">
								<label class="control-label">是否推荐</label>
								<div class="controls">
									<input type="radio" name="istop" value="1">推荐
									<input type="radio" name="istop" value="0" checked="checked">不推荐
								</div>
							</div>
							<div class="control-group logo">
								<label class="control-label">图标</label>
								<div class="controls">
									<div>
										<input type="hidden" name="smeta[thumb]" id="thumb" value="">
										<a href="javascript:upload_one_image('图片上传','#thumb');">
											<img src="__TMPL__Public/assets/images/default-thumbnail.png" id="thumb-preview" width="135" style="cursor: hand" />
										</a>
										<input type="button" class="btn btn-small" onclick="$('#thumb-preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;" value="取消图片">
									</div>
								</div>
							</div>

						</fieldset>
		          </div>

		        </div>
		    </div>
		    <div class="form-actions">
		     	<button class="btn btn-primary js-ajax-submit"type="submit">{:L('ADD')}</button>
		      	<a class="btn" href="javascript:history.back(-1);">{:L('BACK')}</a>
		    </div>
		</form>
	</div>
	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
	<script type="text/javascript">
		$(function(){
			$('#A').find('select[name=taxonomy]').change(function(){
				var cate = $(this).children('option:selected').val();
				if(cate == "merch"){
					$('#A .istop').css('display','block');
					$('#A .logo').css('display','block');
				}else{
					$('#A .istop').css('display','none');
					$('#A .logo').css('display','none');
				}

			});
		});
	</script>
</body>
</html>